<!DOCTYPE html>
<html lang="en">

<include file="CommonSidebar:common-head"/>
<link rel="stylesheet" href="__ROOT__/Application/Admin/Public/css/common.css">
<link href="__ROOT__/Application/Admin/Public/css/jquery.datetimepicker.css" rel="stylesheet">
<body>

<div id="wrapper">

    <div id="page-wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <hr>
                    <a href="{:U('/ERPAPI/GetOrderData')}">
                        <button class="btn  btn-primary">不选择取消返回</button>
                    </a>
                    <hr>
                </div>
            </div>
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">康欣内码列表</h1>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
                    <div class="panel panel-default">
                        <div class="panel-heading" role="tab" id="headingOne">
                            <h4 class="panel-title">
                                <a role="button" data-toggle="collapse" data-parent="#accordion"
                                   href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                                    搜索栏
                                </a>
                            </h4>
                        </div>
                        <div id="collapseOne" class="panel-collapse collapse in" role="tabpanel"
                             aria-labelledby="headingOne">
                            <div class="panel-body">
                                <form action="{:U('/ERPAPI/GETCODEINDEX')}" class="form-horizontal"
                                      method="get">
                                    <input name="is" value="{$is}" type="hidden">
                                    <input name="aa" value="{$aa}" type="hidden">
                                    <input name="bb" value="{$bb}" type="hidden">
                                    <input name="ss" value="1" type="hidden">

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">国药批发号</label>

                                        <div class="col-sm-4">
                                            <input name="PFH" type="text" class="form-control" value="{$PFH}">
                                        </div>
                                        <label class="col-sm-2 control-label">商品名称</label>

                                        <div class="col-sm-4">
                                            <input name="NAME" type="text" class="form-control" value="{$NAME}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">供货厂家</label>

                                        <div class="col-sm-4">
                                            <input name="CJ" type="text" class="form-control" value="{$CJ}">
                                        </div>
                                        <label class="col-sm-2 control-label">默认数据条数</label>

                                        <div class="col-sm-4">
                                            <input name="NUM" type="number" class="form-control" value="20">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-10 col-sm-offset-2">
                                            <button type="submit" class="btn  btn-primary">筛选</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        订单
                        <label style="color:red;">{$DFHDATA['title']}|||||{$DFHDATA['sku_properties_name']}||||||{$DFHDATA['alias']}</label>
                    </div>
                    <!-- /.panel-heading -->
                    <div class="panel-body">
                        <div class="dataTable_wrapper">
                            <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                <thead>
                                <tr>
                                    <th style="text-align:center">ERP内码</th>
                                    <th style=" text-align:center">商品名称</th>
                                    <th style=" text-align:center">商品规格</th>
                                    <th style=" text-align:center">供货厂家</th>
                                    <th style=" text-align:center">国药批发号</th>
                                    <th style="text-align:center">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <foreach name="DATA" item="v">
                                    <tr class="odd gradeX">
                                        <td>{$v.ERP_CODE}</td>
                                        <td>{$v.NAME}</td>
                                        <td>{$v.GG}</td>
                                        <td>{$v.CJ}</td>
                                        <td>{$v.PFH}</td>
                                        <td>
                                            <if condition="$DFHDATA">
                                                <input type="button" class="btn-cancel" name="close" value="选择"/>
                                                <input type="hidden" name="ID" value="{$v.ID}">
                                            </if>
                                        </td>
                                    </tr>
                                </foreach>
                                </tbody>
                            </table>
                        </div>
                        <!-- /.table-responsive -->
                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
    </div>
    <!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->


<include file="CommonSidebar:common-script"/>
<script src="__ROOT__/Application/Admin/Public/js/jquery.datetimepicker.js"></script>
<!-- DataTables JavaScript -->
<script src="__ROOT__/Application/Admin/Public/bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="__ROOT__/Application/Admin/Public/bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="__ROOT__/Application/Admin/Public/dist/js/sb-admin-2.js"></script>
<!-- Page-Level Demo Scripts - Tables - Use for reference -->
<script>
    $(document).ready(function () {
        $('#dataTables-example').DataTable({
            responsive: true
        });
    });
</script>
<script>
    $(document).on("click", ".btn-cancel", function () {
        var url = $(this).attr("data-url");
        var ID = $(this).next().val();
        if (confirm("确认选择ERP内码？")) {
            location.href = "{:U('ERPAPI/SelectCode')}?alias={$DFHDATA['alias']}&ID=" + ID;
        }
    });
</script>

</body>

</html>
